﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace MiaProject
{
    public class Explosion2D
    {
        public ExplosionParticleSystem2D explosion;
        public ExplosionSmokeParticleSystem2D smoke;

        public const float TimeBetweenExplosions = 2.0f;
        public float timeTillExplosion = 0.0f;
        public Boolean status;

        public Explosion2D()
        {
            status = true;
        }

        public void LoadContent(GraphicsDevice graphicsDevice, ContentManager content)
        {
            explosion.LoadContent(graphicsDevice, content);
            smoke.LoadContent(graphicsDevice, content);
        }

        public Boolean isFinish()
        {
            return (explosion.allParticlesFree && smoke.allParticlesFree);
        }
        public void Draw(GameTime gameTime, SpriteBatch spriteBatch, GraphicsDeviceManager graphics)
        {
            if (status)
            {
                smoke.Draw(gameTime, spriteBatch, graphics);
                explosion.Draw(gameTime, spriteBatch, graphics);
            }
        }
    }
}
